#include <iostream>
using namespace std;

struct result{
    int x;
    int y;
    int d;
};

result ext_Euclid(int a, int b)
{
    result r, r0;

    if (b == 0){
        r.x = 1; r.y = 0; r.d = a;
        return r;
    }
    r0 = ext_Euclid(b, a%b);
    r.x = r0.y; r.y = r0.x-a/b*r0.y, r.d = r0.d;
    return r;
}

void exam05(void)
{
    result r;

    r = ext_Euclid(10, 11);
    cout << r.x << "\t" << r.y << "\t" << r.d << endl;
}
